<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .container {
      width: 500px;
      height: 500px;
      background-color: orange;

      display: flex;
      flex-wrap: wrap;

      justify-content: space-between;
      align-content: center;/*决定了多行flex items在cross axis上的对齐方式，用法与justify-content类似*/
      /* 
        口stretch(默认值):与align-items的stretch类似
        口flex-start:与cross start对齐
        口flex-end:与cross end对齐
        口center:居中对齐
        口space-between:
          √flex items之间的距离相等
          √与cross start、cross end两端对齐
        口space-around:
          √flex items之间的距离相等
          √flex items与cross start、cross end之间的距离是flex items之间距离的一半
        口space-evenly:
          √flex items之间的距离相等
          √flex items与cross start、cross end之间的距离等于flex items之间的距离
      */
    }

    .item {
      width: 120px;
      height: 120px;
      /* margin-bottom: 10px; */
    }
  </style>
</head>
<body>
  
  <div class="container">
    <div class="item item1">1x</div>
    <div class="item item2">2x</div>
    <div class="item item3">3x</div>
    <div class="item item4">4x</div>
    <div class="item item2">2x</div>
    <div class="item item3">3x</div>
    <div class="item item4">4x</div>
    <div class="item item2">2x</div>
    <div class="item item3">3x</div>
    <div class="item item4">4x</div>
  </div>

  <script src="./js/itemRandomColor.js"></script>
</body>
</html>